<%@ page language="java" import="java.util.*,com.bean.*,com.dao.*" pageEncoding="utf-8"%>
<%
	String cardno = request.getParameter("cardno");
	String type = "存入";
	String tdate = request.getParameter("tdate");
	float money = Float.parseFloat(request.getParameter("money"));
	TradeBean bean= new TradeBean();
	bean.setCardno(cardno);
	bean.setTdate(tdate);
	bean.setType(type);
	bean.setMoney(money);
	
	TradeDao dao = new TradeDao();
	AccountDao daos = new AccountDao();
	AccountBean beans = new AccountBean();
	float mm = daos.selectByno(cardno).getMoney();
	mm = mm + money;
	
	beans.setNo(cardno);
	beans.setMoney(mm);
	daos.updateBank(beans);
	if(dao.addTrade(bean)>0){
		response.sendRedirect("save.jsp");
	}
%>

